<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="java.util.Calendar"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
		String sid = session.getId();
		String value = (String) session.getAttribute("key1");
		if (value == null) {
			out.println("<p>session " + sid + " has no value for key1</p>");
		} else {
			out.println("<p>session " + sid + " has the value for key1 " + value + "</p>");
		}
		session.setAttribute("key1", "newValue" + Calendar.getInstance().getTimeInMillis());
		value = (String) session.getAttribute("key1");
		out.println("<p>session " + sid + " has the value for key1 " + value + "</p>");
		session.invalidate();
		out.println("<p>invalidate the session " + sid + "</p>");
	%>

</body>
</html>